<?php
namespace app\sendmsg\model;
use app\BaseModel;
class UserSend extends BaseModel
{
    protected $name = 'longbing_card_user_send';
    public function getlist($where,$page,$list_rows){
        $data =$this->where($where)->order('create_time','desc')->field('id,content,label_id_list,create_time')->paginate([ 'list_rows' => $list_rows, 'page' => $page ])->each(function ($item, $key){
           $item['label_count'] = count($item['label_id_list']);
            $item['time'] = date('Y-m-d H:i:s',$item['create_time']);
           return $item;
       });
        return $data;
    }
    public function getLabelIdListAttr(string $name)
    {
        $label = new CardLabel();
        $list =$label->getListName($name);
       return $list;
    }
}